package com.zygh.dlqwservice.module.controller.app;


import com.zygh.dlqwservice.common.anno.ViLog;
import com.zygh.dlqwservice.common.domain.ResultBeans;
import com.zygh.dlqwservice.common.domain.ResultUtils;
import com.zygh.dlqwservice.constant.SwaggerTagConst;
import com.zygh.dlqwservice.module.entity.Jobs;
import com.zygh.dlqwservice.module.service.IJobsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author lee
 * @since 2020-12-25
 */
@RestController
@RequestMapping("/app/jobs")
@Api(tags = {SwaggerTagConst.Admin.MANAGER_APP_JOBS})
public class AppJobsController {
    @Resource
    private IJobsService iJobsService;

    /**
     * 日常勤务根据登录人查看所对应的岗位，传deptId
     *
     * @param jobs 封装参数
     * @return ResultBeans
     */
    @ApiOperation("日常勤务岗位信息")
    @PostMapping("/battion")
    @ViLog(logType = "1", module = SwaggerTagConst.Admin.MANAGER_APP_JOBS,content = "日常勤务岗位信息")
    public ResultBeans battion(@RequestBody Jobs jobs) {
        List<Jobs> data = iJobsService.getStation(jobs);
        return ResultUtils.resultBeansSuccess(data);
    }

    /**
     * 日常岗位详情下的详情
     *
     * @param jobs 封装参数
     * @return ResultBeans
     */
    @ApiOperation("日常岗位信息下的详情")
    @PostMapping("/battion/detail")
    @ViLog(logType = "1", module = SwaggerTagConst.Admin.MANAGER_APP_JOBS,content = "日常岗位信息下的详情")
    public ResultBeans detail(@RequestBody Jobs jobs) {
        List<Jobs> detail = iJobsService.getDetail(jobs);
        return ResultUtils.resultBeansSuccess(detail);
    }

}
